import Vue from 'vue'
import App from './App'
import VueI18n from 'vue-i18n'
import { en, zh } from './lang/language.js'
import store from './store'
import showModal from '@/static/js/show-modal.js'
import storage from '@/static/js/storage.js'
import vLoading from './components/v-loading'

Vue.use(VueI18n)
Vue.use(vLoading)

Vue.config.productionTip = false
App.mpType = 'app'
// vuex
Vue.prototype.$store = store
// 全局modal
Vue.prototype.$showModal = showModal
// 缓存数据
Vue.prototype.$storage = storage

// 引入全局组件
import dataEmpty from './components/common/data-empty.vue'
Vue.component('data-empty', dataEmpty)
import loading from './components/plugins/loading/loading.vue'
Vue.component('loading', loading)

const i18n = new VueI18n({
	locale: 'zh-CN',
	messages: {
		'en-US': en,
		'zh-CN': zh
	}
})

Vue.prototype._i18n = i18n
const app = new Vue({
	i18n,
	...App,
	store
})
app.$mount()
